<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MVCWeb.Models.Ads>" %>

<%@ Register Src="~/Views/Menu/MainMenu.ascx" TagName="MainMenu" TagPrefix="mmuc" %>
<%@ Register Src="~/Views/Shared/LogOnUserControl.ascx" TagName="LogOnUserControl" TagPrefix="louc" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <title>Create Ads</title>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <script type="text/javascript">
        $(document).ready(function() {
            $("#AdsForm").validate({
                rules: {
                    Type: {
                        required: true
                    },
                    ContributionAmt:
                    {
                        required: true,
                        number: true
                    },
                    ContributionType: {
                        required: true
                    },

                },
                messages: {
                    Type: {
                        required: "Ads Type must be entered"
                    },
                    ContributionAmt: {
                        required: "Contribution Amt must be entered",
                        number: "Contribution Amt must be only valid number"            
                    },
                    ContributionType: {
                        required: "Contribution Type must be entered"
                    }
                }
            });
            $("#submit_view").click(function() {
                $("#IsRedirectToView").val("true");
            });
        });
    </script>

    <louc:LogOnUserControl ID="LogOnUserControl1" runat="server" />
     <!-- BEGIN: MainMenu -->    
    <mmuc:MainMenu ID="MainMenu1" runat="server" />
    <!-- END: MainMenu -->
    <br />
    <%= Html.ValidationSummary("Create was unsuccessful. Please correct the errors and try again.") %>
    <% using (Html.BeginForm("Create", "Ads", FormMethod.Post, new { id = "AdsForm" }))
       {%>
    <fieldset>
        <legend>Create Ads</legend>
        <p>
            <label for="Type">
                Ads Type:</label>
            <%= Html.TextBox("Type") %>
            <%= Html.ValidationMessage("Type", "*") %>
        </p>
        <p>
            <label for="Description">
                Description:</label>
            <%= Html.TextBox("Description") %>
            <%= Html.ValidationMessage("Description", "*") %>
        </p>
        <p>
            <label for="ContributionAmt">
                Contribution Amt:</label>
            <%= Html.TextBox("ContributionAmt") %>
            <%= Html.ValidationMessage("ContributionAmt", "*") %>
        </p>
        <p>
            <label for="ContributionType">
                Contribution Type:</label>
            <%= Html.TextBox("ContributionType") %>
            <%= Html.ValidationMessage("ContributionType", "*") %>
        </p>
        <p>
            <label for="DisplayTemplate">
                Display Template:</label>
            <%= Html.TextBox("DisplayTemplate") %>
            <%= Html.ValidationMessage("DisplayTemplate", "*") %>
        </p>
        <p>
            <%= Html.Hidden("IsRedirectToView")%>
            <input id="submit" name="submit" type="submit" value="Save & New" />
            <input id="submit_view" name="submit_view" type="submit" value="Save & View" />            
            <input type="reset" value="Reset" />
        </p>
    </fieldset>
    <% } %>
    <div>
        <%=Html.ActionLink("Back to List", "Index") %>
    </div>
</asp:Content>
